########################################################################
#
#       ORIGIN:     FUYONG .
#       GROUP:      
#       PROJECT:    USED FOR GCC Makefile
#       DATE:       April 2009.
#       PURPOSE:    Standard application makefile
#                   
#       NOTE:       This include makefile assumes the source modules
#                   are organised into the linux directory structure.
#
#       $Revision: $
#       $Date: 7-Jan-2009.09:35:44 $ 
########################################################################

TARGET = $(ROOT_DIR)/lib/libgtdriver.a
include $(PROJECT_DIR)/config/plantform.mk
#	INCLUDE MODULE (DRIVER,APPLICATION,MIDWARE)
include $(ROOT_DIR)/driver/source/driver.mk
#	END INCLUDE MODULE

C_OBJECT = $(patsubst %.c,$(OUT_DIR)/%.o,$(C_SOURCE))
CPP_OBJECT = $(patsubst %.cpp,$(OUT_DIR)/%.o,$(CPP_SOURCE))

$(OUT_DIR)/%.o:%.c
	$(CC) $(CFLAGS)  -c -g $< -o $@ $(INCLUDES) $(PROJ_CPL_MACRO)

$(OUT_DIR)/%.o:%.cpp
	$(CPP) $(CFLAGS) $(CPPFLAGS) -c -g $< -o $@ $(INCLUDES) $(PROJ_CPL_MACRO)	
	
all: $(TARGET)
$(TARGET):$(C_OBJECT) $(CPP_OBJECT)
	$(AR) $@ $(C_OBJECT) $(CPP_OBJECT)
clean:
	rm -rf $(TARGET)
	rm -rf $(C_OBJECT) $(CPP_OBJECT)	